%图像旋转,顺时针和逆时针旋转
img1=imread('img.jpg');
img2=imrotate(img1,30,'nearest','crop');
img3=imrotate(img1,30,'nearest');
%显示
subplot(1,3,1);imshow(img1);title("原图");
subplot(1,3,2);imshow(img2);title("原图旋转30");
subplot(1,3,3);imshow(img3);title("自适应旋转30");